import axios from '@/utils/myaxios.js'

export const mypost = (params) => {
  return axios({
    //新闻首页接口
    url: '/post',
    params
  })
}
export const postId = (id) => {
  return axios({
    //新闻详情接口
    url: '/post/' + id,
  })
}
export const user_follows = (id) => {
  return axios({
    //关注接口
    url: '/user_follows/' + id,
  })
}
export const user_unfollow = (id) => {
  return axios({
    //取消关注接口
    url: '/user_unfollow/' + id,

  })
}
export const post_like = (id) => {
  return axios({
    //点赞接口
    url: '/post_like/' + id,

  })
}
export const post_star = (id) => {
  return axios({
    //收藏接口
    url: '/post_star/' + id,

  })
}
export const myuser_follows = () => {
  return axios({
    //获取关注数据接口
    url: '/user_follows',
  })
}
export const user_star = () => {
  return axios({
    //获取收藏数据接口
    url: '/user_star',
  })
}
export const post_search = function (key) {
  return axios({
    //搜索文章接口
    url: '/post_search?keyword=' + key,
  })
}